import type { LoginResult } from '@/types/profile'
import { http } from '@/utils/http'

type LoginParams = {
  encryptedData: string
  code: string
  iv: string
}
// 企业开发 登陆
export const postLoginWxMin = (data: LoginParams) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin',
    data,
  })
}

// 个人开发 登陆
export const postLoginWxMinSimple = (phoneNumber: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber,
    },
  })
}

// 账号密码登录

export const loginBypassword = (form: { account: string; password: string }) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login',
    data: form,
  })
}
